package com.dfrz.stockMarket.web;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dfrz.stockMarket.bean.StockBean;
import com.dfrz.stockMarket.model.StockLogModel;
import com.dfrz.stockMarket.model.StocksModel;

@WebServlet("/homecontroll")
public class indexController extends BaseController{
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		List<StockBean> stockBeans = new ArrayList<StockBean>();
		List<StockLogModel> stockLog = new ArrayList<StockLogModel>();
		StockLogModel stockLogModel = new StockLogModel();
		StocksModel stocksModel = new StocksModel(10001, "东方百货", 22);
		stockLog.add(stockLogModel);
		stockBeans.add(new StockBean(stocksModel, stockLog));
		setSession(req, "list", stockBeans);
		req.getRequestDispatcher("WEB-INF/jsp/home.jsp").forward(req, resp);
	}
	
}
